import Vue from 'vue'
import VueRouter from 'vue-router'
import huangRouter from './huang_Router'
import zrouting from './zrouting'
import store from '../store'
Vue.use(VueRouter)
const routes= [
    ...huangRouter,
    ...zrouting,
]
const router = new VueRouter({
    routes:routes,
})

router.beforeEach((to,from,next)=>{
    let {path} = to;
    store.commit('huang/pathFromMut',from.path)
    if(to.path=="/personal" && !sessionStorage.userinfo){
        next('/login')
    }
    next();
})
export default router;